package com.xuqi.Animation;

import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.Button;

import com.xuqi.R;
import com.xuqi.menucontrol.SCR_MenuBase;

public class SimpleAlpha extends SCR_MenuBase
{
	private Button m_Button = null;
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.animation);
		m_Button = (Button) findViewById(R.id.bt_animation);
		
		m_Button.setOnClickListener(new View.OnClickListener()
		{
			
			@Override
			public void onClick(View v)
			{
				// TODO Auto-generated method stub
				m_Button.startAnimation(alphaAnimation());
			}
		});
		
	}

	private Animation alphaAnimation()
	{
		Animation animAlpa0_2_100;
//		animAlpa0_2_100 = AnimationUtils.loadAnimation(this, R.anim.alpha_0_to_100);
		animAlpa0_2_100 = new AlphaAnimation(0.0f,1.0f);
		animAlpa0_2_100.setRepeatCount(3);
		animAlpa0_2_100.setRepeatMode(Animation.REVERSE);
		animAlpa0_2_100.setDuration(4000);
		return animAlpa0_2_100;
	};

}
